home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_rampspeedo.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  142 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_RampSpeedO.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     user0
  14.     message     user1
  15.     message     user2
  16.     message     entered
  17.     message     pulse
  18.     
  19.     thing       player      local
  20.     thing       car         local
  21.     
  22.     surface     trig1
  23.     surface     trig2
  24.     surface     trig3
  25.     surface     trig4
  26.     
  27.     sound       landing=sol_minecar_landing_c.wav   local   # mine car landing sfx
  28.     
  29.     vector      curVel      local
  30.     flex        speedO      local
  31.     int         blownUp=0   local
  32.     int         enabled=1   local
  33.     
  34. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39.  
  40. startup:
  41.  
  42.     # turn on speedometer
  43.     #SetPulse(2.0);
  44.     
  45.     Sleep(0.01);
  46.     player = GetLocalPlayerThing();
  47.     
  48.     return;
  49.     
  50. # ========================================================================================
  51.  
  52. user0:
  53.  
  54.     blownUp = 1;
  55.     return;
  56.     
  57. # ========================================================================================
  58.  
  59. user1:
  60.  
  61.     # disable this cog
  62.     enabled = 0;
  63.     return;
  64.     
  65. # ========================================================================================
  66.  
  67. user2:
  68.  
  69.     # enable this cog
  70.     enabled = 1;
  71.     return;
  72.     
  73. # ========================================================================================
  74.  
  75. entered:
  76.  
  77.     player = GetLocalPlayerThing();
  78.     car = GetSourceRef();
  79.     curVel = GetThingVel(player);
  80.     speedO = VectorLen(curVel);
  81.     
  82.     if((BitTest(GetPhysicsFlags(car), 0x01000000)) && (blownUp == 1) && (enabled == 1))
  83.     {
  84.         if(GetSenderRef() == trig1)
  85.         {
  86.             # do cutscene stuff
  87.             StartCutscene(0);
  88.             SetActorFlags(player, 0x200000);
  89.             
  90.             if(speedO < 0.34)   # 2 presses
  91.             {
  92.                 #Print("speed to 2.5");
  93.                 SetThingThrust(player, '0.0 2.5 0.0');
  94.             }
  95.         }
  96.             
  97.         if(GetSenderRef() == trig2)
  98.         {
  99.             if(speedO < 0.46)   # 4 presses
  100.             {
  101.                 #Print("speed to 3.0");
  102.                 SetThingThrust(player, '0.0 3.0 0.0');
  103.             }
  104.         }
  105.         
  106.         if(GetSenderRef() == trig3)
  107.         {
  108.             if(speedO < 0.9)
  109.             {
  110.                 #Print("speed to 0.9");
  111.                 SetThingThrust(player, '0.0 4.0 0.0');
  112.             }
  113.         }
  114.         
  115.         if(GetSenderRef() == trig4)
  116.         {
  117.             # play landing sfx on other side of hole
  118.             PlaySoundLocal(landing, 1.0, 0.0, 0x0, 0);
  119.             
  120.             # restore player controls
  121.             ClearActorFlags(player, 0x200000);
  122.             EndCutscene();
  123.         }
  124.     }
  125.         
  126.     return;
  127.        
  128. # ========================================================================================
  129.  
  130. pulse:
  131.  
  132.     player = GetLocalPlayerThing();
  133.     curVel = GetThingVel(player);
  134.     speedO = VectorLen(curVel);
  135.     PrintFlex(speedO);
  136.     return;   
  137.     
  138. # ========================================================================================
  139.  
  140. end
  141.  
  142.